{% extends "mybase2.html" %}
{% from 'bootstrap/form.html' import render_form %}
{% from 'bootstrap/form.html' import render_form_row %}

{% block title %} bootstrap和form表单结合使用 {% endblock %}

{% block style %}
    {{ super() }}
    <style>
    
    </style>

{% endblock %}

{% block content %}
    {# 快速把form表单生成 #}
    {{ render_form(loginform,form_type='horizontal',horizontal_columns=('sm',1,3)) }}

    {# 渲染单独的form表单项 #}
    {#<p>{{ render_form_row([loginform.username], form_type='horizontal',horizontal_columns=('sm',1,3)) }}</p>#}

{#<form method="post" action="{{ url_for('user.boot_form_user')}}" enctype="multipart/form-data">#}

    {#{{ render_form(loginform, button_map={'submit_button':'btn primary'},form_type='horizontal',horizontal_columns=('sm',1,3)) }}
     <p>{{ loginform.recaptcha.label }}:{{ loginform.recaptcha}} 
        <img id="img" src="{{ url_for('user.get_image') }}" alt="验证码" />
         <span class="error_p">{% if loginform.recaptcha.errors %} {{ loginform.recaptcha.errors }} {% endif %}</span>
    </p>

    #}
    {#{{ loginform.hidden_tag() }}
    <div class="form-group row">
        <label for="{{ loginform.username.id }}" class="col-sm-2 col-form-label form-control-label">{{ loginform.username.label.text }}</label>
        <div class="col-sm-5">
            {{ loginform.username(class="form-control") }}
            {% for error in loginform.username.errors %}
                <span class="error_p text-danger">{{ error }}</span>
            {% endfor %}
        </div>
       

    </div>#}
 
    <p><input type="submit" value="提交" /></p>


  {#  {{ loginform.csrf_token }}
    {{ wtf.quick_form(loginform, button_map={'submit':'primary'},horizontal-columns=('lg,5,2')) }}
#}


{% endblock %}

{% block script %}
{{super()}}

<script>
    

</script>
{% endblock %}
